package com.lj.back.manage.scaffold.common.constant;

import com.lj.back.manage.scaffold.common.enums.OrderTypeEnum;

import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

/**
 * 全局常量类
 * @author lv
 * @version 1.0.0
 */
public class Constant {

    private Constant(){}

    /**
     * 验证码---默认过期时间  单位秒
     */
    public static final long CODE_DEFAULT_EXPIRE_TIME_GRAPH = 60 * 5;

    /**
     * 验证码长度
     */
    public static final int CODE_LENGTH = 6;

    /**
     * 日期格式化
     */
    public static final String DATE_FORMAT = "yyyy-MM-dd";

    /**
     * 时间格式化
     */
    public static final String TIME_FORMAT = "HH:mm:ss";

    /**
     * 时间格式化
     */
    public static final String DATE_TIME_FORMAT = DATE_FORMAT+" "+TIME_FORMAT;

    /**
     * 对象名称分隔符
     */
    public static final String SEPARATOR_BEAN_NAME = "#";

    /**
     * 时区
     */
    public static final String TIME_ZONE = "GMT+8";

    /**
     * 时间格式化对象
     */
    public static final DateTimeFormatter FORMATTER = DateTimeFormatter
            .ofPattern(Constant.DATE_TIME_FORMAT)
            .withZone(ZoneId.of(Constant.TIME_ZONE));

    /**
     * 默认分页当前页码
     */
    public static final int DEFAULT_PAGE_CURRENT = 1;

    /**
     * 默认分页每页显示数量
     */
    public static final int DEFAULT_PAGE_SIZE = 10;

    /**
     * 默认分页排序方式
     */
    public static final String DEFAULT_PAGE_ORDER_TYPE = OrderTypeEnum.DESC.getCode();

    /**
     * 默认分页排序字段
     */
    public static final String DEFAULT_PAGE_ORDER_FIELD = "create_time";
}
